#define _CRT_SECURE_NO_WARNINGS 2

#include<stdio.h>
#include<stdbool.h>

struct TreeNode {
	 int val;
     struct TreeNode* left;
	 struct TreeNode* right;
	 
};

struct TreeNode* invertTree(struct TreeNode* root) {
	if (root == NULL)
		return NULL;
	struct TreeNode* tmp = root->left;
	root->left = root->right;
	root->right = tmp;
	invertTree(root->left);
	invertTree(root->right);
	return root;
}

bool SymmetriceTree(struct TreeNode* leftRoot, struct TreeNode* rightRoot) {
	if (!leftRoot && !rightRoot)
		return true;
	if (!leftRoot||!rightRoot)
		return false;
	if (leftRoot->val != rightRoot->val)
		return false;
	return SymmetriceTree(leftRoot->left, rightRoot->right) && SymmetriceTree(leftRoot->right, rightRoot->left);
}

bool isSymmetric(struct TreeNode* root) {
	return SymmetriceTree(root->left, root->right);
}

bool isSame(struct TreeNode* root, struct TreeNode* subRoot) {
	if (root == NULL && subRoot == NULL)
		return true;
	if (!root || !subRoot)
		return false;
	if (root->val != subRoot->val)
		return false;
	return isSame(root->left, subRoot->left) && isSame(root->right, subRoot->right);
}

bool isSubtree(struct TreeNode* root, struct TreeNode* subRoot) {
	if (root == NULL && subRoot == NULL)
		return true;
	 
	if (isSame(root, subRoot))
		return true;
	return isSubtree(root->left, subRoot) || isSubtree(root->right, subRoot);
}

int  main() {
	return 0;
}